import '../../hj_model/home/video_list_resp.dart';
import '../http_manager.dart';

class FindService {
  //获取发现-pk打榜数据
  static Future<VideoListResp?> vidRanking(
    int page,
    int size, {
    String? newsType, //SP-视频 COVER-帖子 PIC-图集
    int? type, //1-日榜 2-周榜 3-月榜 4-总榜
  }) async {
    final param = {
      'pageNumber': page,
      'pageSize': size,
      'newsType': newsType,
      'type': type,
    };
    param.removeWhere((k, v) => v == null);
    final result = await httpManager.fetchResponseByGET(
      '/vid/ranking',
      param: param,
      jsonTransformation: (json) => VideoListResp.fromJson(json),
    );

    return result.data;
  }
}
